# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=libax25
pkgver=0.0.12
_patchver=rc5
pkgrel=4
pkgdesc="set of functions making it easier to write hamradio programs"
url="https://linux-ax25.in-berlin.de/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="autoconf automake zlib-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://linux-ax25.in-berlin.de/pub/libax25/libax25-$pkgver-$_patchver.tar.gz
	musl.patch
	20230513-upstream.patch
	"
builddir="$srcdir"/$pkgname-$pkgver-$_patchver

prepare() {
	default_prepare
	update_config_sub
}

build() {
	export CBUILD=$CHOST
	export LDFLAGS="$LDFLAGS -lz"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--enable-shared \
		--enable-static \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
01aaf1ef5be7a347ec702f890e26e7cad02eff1cc8b4932fe9452cab8012bb0d7cd25f74871d83f188f22a3a5fd600ec57131ddb540a6c746908bf47e42f958f  libax25-0.0.12-rc5.tar.gz
e890378c47b3803182f28c7b88ec7db37ec7204f69e7eddf7bd88a76164b3141b8a3278a8985c6c921471caf3b62db046c04b1becd4810f98f3965b0441a6c94  musl.patch
7095af1f1403804041c57b99f52a7130508aaa790ed3afc14d6ffc02fd3e4ddc9b72f06b942660a635d57393b26a4948d2f5c25a8057a938afcb025e12bbbe75  20230513-upstream.patch
"
